package recallin.gui;

import org.mapsforge.android.maps.MapView;
import org.mapsforge.android.maps.overlay.ArrayCircleOverlay;
import org.mapsforge.android.maps.overlay.ArrayItemizedOverlay;
import org.mapsforge.android.maps.overlay.OverlayCircle;
import org.mapsforge.android.maps.overlay.OverlayItem;
import org.mapsforge.core.GeoPoint;

import recallin.activities.MainActivity;

import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Message;

public class SelectionOverlays extends ArrayItemizedOverlay {
	
	OverlayItem item = new OverlayItem(null, "", "");
	private MainActivity activity;

	public SelectionOverlays(Drawable defaultMarker, MainActivity activity) {
		super(defaultMarker);
		this.activity = activity;
	}

	@Override
	public boolean onLongPress(GeoPoint geoPoint, MapView mapView) {
		this.removeItem(item);
		item.setPoint(geoPoint);
		this.addItem(item);
		Message message = new Message();
		message.what = MainActivity.MAP_DIALOG;
		message.obj = geoPoint;
		activity.mHandler.sendMessage(message);
		return super.onLongPress(geoPoint, mapView);
	}

}
